package com.wit.witmg.api;


import com.wit.witmg.service.ITEDdataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author bob
 * @since 2025-03-25
 */
@RestController
@RequestMapping("teddata")
@Api(tags = "直流分选API")
public class TEDdataController {
    @Resource
    private ITEDdataService service;

    @ApiOperation("添加")
    @PostMapping("add")
    public Object add(HttpServletRequest request,
                      @RequestParam("sn") String sn,
                      @RequestBody String json) {
        return service.add(request,sn,json);
    }

    @ApiOperation("获取")
    @PostMapping("get")
    public Object get(HttpServletRequest request,
                      @RequestParam(value = "ph",required = false) String ph,
                      @RequestParam(value = "xh",required = false) String xh) {
        return service.get(request,ph,xh,false);
    }

}
